package com.financing.wap.service.impl;


import java.sql.SQLException;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpShopSigninDTO;
import com.financing.wap.service.IFpShopSigninService;
import com.financing.wap.util.DTOdateSetUtil;
import com.financing.wap.dao.IFpShopSigninDao;
/**
 * fp_shop_signin  
 *  业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopSigninService")
public class FpShopSigninServiceImpl implements IFpShopSigninService{

	@Autowired
	private IFpShopSigninDao fpShopSigninDao;

	@Override
	public void insert(FpShopSigninDTO fpShopSignin) throws SQLException {
		DTOdateSetUtil.setCreateInfo(fpShopSignin);
		DTOdateSetUtil.setUpdateInfo(fpShopSignin);
//		fpShopSignin.setDeleteTag(CommonStatus.DELETE_TAG_NORMAL);
		fpShopSigninDao.insert(fpShopSignin);
	}

	@Override
	public void update(FpShopSigninDTO fpShopSignin) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpShopSignin);
		fpShopSigninDao.update(fpShopSignin);
	}

	@Override
	public void updateForce(FpShopSigninDTO fpShopSignin) throws SQLException {
		DTOdateSetUtil.setUpdateInfo(fpShopSignin);
		fpShopSigninDao.updateForce(fpShopSignin);
	}

	@Override
	public void delete(String id) throws SQLException {
		fpShopSigninDao.delete(id);
	}
	
	@Override
	public List<FpShopSigninDTO> queryList(FpShopSigninDTO fpShopSignin) throws SQLException {
		return fpShopSigninDao.queryList(fpShopSignin);
	}

	@Override
	public int queryListCount(FpShopSigninDTO fpShopSignin) throws SQLException {
		return fpShopSigninDao.queryListCount(fpShopSignin);
	}

	@Override
	public FpShopSigninDTO loadById(String id) throws SQLException {
		return fpShopSigninDao.loadById(id);
	}
 	@Override
	public FpShopSigninDTO queryListGetFirst(FpShopSigninDTO fpShopSignin)
			throws SQLException {
		 List<FpShopSigninDTO> queryList = queryList(fpShopSignin);
		 if(queryList==null||queryList.size()==0){
			 return new FpShopSigninDTO();
		 }
		 return queryList.get(0);
	}

	@Override
	public int querySortByTotal(String id) throws SQLException {
		return fpShopSigninDao.querySortByTotal(id);
	}

	@Override
	public int querySortByTime(String id) throws SQLException {
		return fpShopSigninDao.querySortByTime(id);
	}

	@Override
	public List<FpShopSigninDTO> queryTopTen() throws SQLException {
		return fpShopSigninDao.queryTopTen();
	}
}